package com.ruijie.mvc.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.ruijie.orm.entity.User;
import com.ruijie.orm.mapper.UserMapper;

@Service
public class RestHelloServices {

	@Autowired UserMapper mapper;

	@Cacheable(key="#userName",value="userCache")
	public User getUser(String userName){
		return mapper.getUser(userName);
	}
//	@CachePut  add
	
	@CacheEvict(key="#userName",value="userCache")
	public String removeUser(String userName){
		return userName;
	}
	
	
}
